package city.spring.modules.consumptionItem.vo;

import city.spring.modules.consumptionItem.action.model.AbstractProjectBed;
import city.spring.modules.consumptionItem.entity.ProjectBedRelationEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class ProjectBedRelationEntityVO extends ProjectBedRelationEntity {
    /**
     * 转换成出库时所需要的对象
     */
    public AbstractProjectBed<ProjectBedRelationEntityVO> toProjectBed() {
        ProjectBedRelationEntityVO item = this;
        return new AbstractProjectBed<ProjectBedRelationEntityVO>() {

            @Override
            public Object getKey() {
                return item.getBedId();
            }

            @Override
            public ProjectBedRelationEntityVO getObject() {
                return item;
            }
        };
    }
}
